(function($){
    function formResult(msg, state) {
        layer.closeAll();
        progress.done();
        if(state === 0) {
            if(msg !== '' && msg !== null) {
                layer.alert(msg, {icon: 5});
            }else{
                layer.alert("error!", {icon: 5});
            }

        } else {
            if(msg !== '' && msg !== null){
                layer.confirm(msg, {icon: 6, title:'系统提示', btn: ['确定']}, function(index){
                    location.href = $('#post-form').attr('callback');
                });
            }else{
                location.href = $('#post-form').attr('callback');
            }
        }
    }
    $(function(){
        window.formResult = formResult;
        window.progress = $.AMUI.progress;
        $("#post-form").submit(function () {
            progress.start();
            return true;
        });

        $(".confirm").click(function () {
            var message = $(this).attr("data-message");
            var url = $(this).attr("data-url");
            layer.confirm(message, {
                btn: ['是','否'] //按钮
            }, function(){
                progress.start();
                window.ifr_send_file.location.href = url;
            }, function(){

            });
            return false;
        });

        $(".jump").click(function(){
            location.href = $(this).attr("data-url");
            return false;
        })




    })

})(jQuery);

